package com.cx.dubbo.controller;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import com.alibaba.dubbo.config.annotation.Reference;
import com.cx.base.apiModel.ApiModel;
import com.cx.base.autoDoc.annotations.AutoDocField;
import com.cx.base.autoDoc.annotations.AutoDocMethod;
import com.cx.base.autoDoc.annotations.AutoDocType;
import com.cx.base.autoReturn.utils.AutoReturnUtil;
import com.cx.base.controller.BaseController;
import com.cx.base.exception.SoaException;
import com.cx.dubbo.common.dto.test.TestReqDTO;
import com.cx.dubbo.common.dto.test.TestResDTO;
import com.cx.dubbo.common.service.test.TestService;

@Controller("test")
@AutoDocType("测试类")
public class TestController extends BaseController{

	@Reference
	private TestService testService;
	
	
	/**
	 * 查询售后订单列表
	 * @return
	 */
	@RequestMapping
	@ResponseBody
	@AutoDocMethod(name = "查询售后订单列表",  desc="applyStatus 为必传参数",resClazz = TestResDTO.class,resSet="list")
	public ApiModel getAftermarkets( TestReqDTO dto,@AutoDocField("查询页数") Integer pageNum,@AutoDocField("返回条数") Integer itemCount,@AutoDocField("处理状态") Integer applyStatus){
		try {
			TestResDTO testResDTO = testService.doTest("test");
			
			return buildSuccMsg(testResDTO);
		} catch (SoaException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
		
		return AutoReturnUtil.getSuccApiModel(this.getClass(), "getAftermarkets");
	}
}
